<admintpl file="header" />
</head>
<body class="J_scroll_fixed">
	<div class="wrap J_check_wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:U('Posts/index')}">活动文章</a></li>
			<li><a href="{:U('Posts/add')}">添加活动</a></li>
		</ul>
		<form class="J_ajaxForm" action="" method="post">
			<table class="table table-hover table-bordered table-list">
				<thead>
					<tr>
						<th width="40">ID</th>
						<th width="30">分类</th>
						<th>标题</th>
						<th>简介</th>
						<th width="60">缩略图</th>
						<th width="40">状态</th>
						<th width="105">发布人/时间</th>
						<th width="30">操作</th>
					</tr>
				</thead>
				<foreach name="posts" item="post">
				<tr>
					<td>{$post.id}</td>
					<td>
						<foreach name="typeconfigs" item="type">
							<if condition = "$type['typeid'] eq $post['post_term']">
								{$type.typename}
							</if>
						</foreach>
					</td>
					<td>
						<a href="{:U('portal/Activity/index',array('id'=>$post['id']))}" target="_blank"> <span>{$post.post_title}</span></a>
						<br> 浏览量（{$post.post_hits}）<if condition="$post['post_push']"><b style="color: red;">已推送</b></if>
					</td>
					<td>{$post.post_excerpt|msubstr=0,32}</td>
					<td>
						<if condition="$post['post_image']">
        					<img src="{$webshowimg}{$post.post_image}" name="{$webshowimg}{$post.post_image}" title="双击查看"style="width: 60px; height: 40px;" ondblclick="image_priview(this.name);" >
	        			<else />
	        				未上传
	        			</if>
					</td>
					<td>
						<if condition="$post['post_istop'] eq 0">
							<a href="{:U('Posts/top',array('id'=>$post['id']))}" class="J_ajax_dialog_btn" data-msg="您确定要置顶此帖吗？">未置顶</a>
						<else />
							<a href="{:U('Posts/down',array('id'=>$post['id']))}" class="J_ajax_dialog_btn" data-msg="您确定要取消置顶此帖吗？"><b style="color: #FF0000;">已置顶</b> </a>
						</if>
						<br>
						<if condition="$post['post_status'] eq 0">
							<a href="{:U('Posts/openpost',array('id'=>$post['id']))}" class="J_ajax_dialog_btn" data-msg="您确定要开启此帖吗？"style="color: #FF0000;"><b>已关闭</b></a>
						<else />
							<a href="{:U('Posts/closepost',array('id'=>$post['id']))}" class="J_ajax_dialog_btn" data-msg="您确定要关闭此帖吗？">未关闭 </a>
						</if>
					</td>
					<td>
						{$post.post_userid}：

						<foreach name="users" item="user">
							<if condition = "$user['id'] eq $post['post_userid']">
								{$user.user_nicename}
							</if>
						</foreach>
						<br>{$post.post_date|substr=0,16}
					</td>
					<td>
						<a href="{:U('Posts/edit',array('id'=>$post['id']))}">修改</a><br> 
						<a href="{:U('Posts/delete',array('id'=>$post['id']))}" class="J_ajax_del">删除</a>
					</td>
				</tr>
				</foreach>
			</table>
			<div class="pagination">{$Page}</div>

		</form>
	</div>
	<script src="__ROOT__/statics/js/common.js"></script>
	<script type="text/javascript" src="__ROOT__/statics/js/content_addtop.js"></script>
</body>
</html>